package com.group_e.Bubble.client;

public class User {
	//New user and returning user will be handled by Google Accounts
	private boolean new_user;
	private String user_email;
	private String user_first_name;
	private String user_last_name;
	private int user_id;
	private final int max_task_main = 1000;
	private final int max_task_process = 1000;
	private final int max_list = 1000;
	private Task complete_task_list[] = new Task[max_list];
	private Task trash_task_list[] = new Task[max_list];
	private Task process_task_list[] = new Task[max_task_process];
	private Task main_task_list[] = new Task[max_task_main];

	public User()
	{
		user_email = null;
	}
	public User(String email)
	{
		user_email = email;
	}
	public void createUser(String first, String last, String email)
	{
		user_email = email;
		user_first_name = first;
		user_last_name = last;
	}
	public void returningUser(String email)
	{
		user_email = email; 
	}
	public void setUser_Email(String email)
	{
		user_email = email;
	}
	public void setUser_First_Name(String first)
	{
		user_first_name = first;
	}
	public void setUser_Last_Name(String last)
	{
		user_last_name = last;
	}
	public String getUser_First_Name()
	{
		return user_first_name;
	}
	public String getUser_Last_Name()
	{
		return user_last_name;
	}
	public String getUser_Email()
	{
		return user_email;
	}
	public int getUser_Id()
	{
		return user_id;
	}
	public boolean newUser(int id)
	{
		if(id == 0)
			new_user = true;
		else
			new_user = true;
		return new_user;
	}
	public Task getTask_Main_List(int num)
	{
		return main_task_list[num];
	}
	public Task getTask_Process_List(int num)
	{
		//Task process_task_list[] = new Task[max_task_process];
		return process_task_list[num];
	}
	public Task getTask_Trash_List(int num)
	{
		return trash_task_list[num];
	}
	public Task getTask_Complete_List(int num)
	{
		return complete_task_list[num];
	}
	public void makeTask_Main_List()
	{
		//TODO database call to task table for all tasks with due date
		//insert into an array of tasks
		//display items as buttons on main tab of grid up to 1000
		//sort by due date
		//Sort command handled by query, just need to do a new query with sort based on due date
		//Only take tasks with due date to input into main list
		//
	}
	public void makeTask_Process_List()
	{
		//TODO database call to task table for all tasks with no due date
		//insert into an array of tasks
		//display items as button on main tab of grid up to 1000
		//sort by expiry date(1 week timer from date created)
	}
	public void makeTask_Trash_List()
	{
		//TODO database call to archive table for all tasks with remove date
		//insert into an array of Task_Trash
		//On call display as FlexTable sorted by date removed
		//4 columns on table, task name, date, remove date, and a final column for button to retrieve task
		//button will recreate task in the process table with only name and date(additional information is lost for now)
		//Given more time would store all information for a period and allow full recreation
		//Currently just getting a trash list up with the ability to recreate a task(by name, and last saved timestamp)
	}
	public void makeTask_ProcessList()
	{
		//TODO database call to archive table for all tasks with complete date
		//insert into an array of Task_Complete
		//on call display as FlexTable sorted by Date Complete
		//3 columns on table; task name, date, and complete date
		//Given more time eventually add the full task information stored for a period of time
		//give users access to the description, tags and other information when reviewing complete list
	}
	public void setTask_Main(Task info)
	{
		//info = new Task_Main(info.getTask_Name(), info.getTask_Date(), info.getTask_Due_Date(), info.getTask_Descrip(), info.getTask_Tag1(), info.getTask_Tag2(), info.getTask_Tag3(), info.getTask_Tag4());
		//TODO use constructor to make a main task
		//commit to database
		//If there is room left in list
		//find correct position and append to list
		//move everything down following placement
		//If there is not room, find position in list
		//If position is in list, push everything following down 1 and insert
		//else do nothing
	}
	public void setTask_Process(Task info)
	{
		//TODO use constructor to make a process task
		//Commit to database
		//If there is room left in list
		//find correct position and append to list
		//move everything following down
		//If there is not room, find position in list
		//If position is in list, push everything down by 1 and insert
		//else do nothing
	}
	public void setTask_Trash(Task info)
	{
		//TODO use constructor to make a trash task
		//Commit to database
		//Sorted by date removed, possible max amount per user_id
		//Will be added as most recent, push everything else down
	}
	public void setTask_Complete(Task info)
	{
		//TODO use constructor to make a complete task
		//Commit to database
		//Sorted by date complete, max amount per user_id
		//Will be added as most recent, push everything down or just append to the end
	}
}
